
from rest_framework import viewsets

from .models import Department
from .serializers import DepartmentSerializer


class DepartmentViewSet(viewsets.ModelViewSet):
    '''
    list: 查询所有Department
    create: 新增Department
    retrieve: 查询单个Department, 文档名: read,接口名: retrieve
    update: 更新Department
    destroy: 删除Department
    '''
    queryset = Department.objects.all()
    serializer_class = DepartmentSerializer

